package com.example.demo.mapper;

import com.example.demo.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface UserMapper {
    // 用户注册
    public int reg(@Param("username") String username, @Param("password") String password);

    // 通过名称查询用户-->用于登录的验证
    public UserInfo selectByUsername(@Param("username") String username);

    // 密码刷新
    public int passwordRefresh(@Param("id") int id, @Param("password") String password);

    //获取收货地址
    public UserInfo getAddress(@Param("uid") int uid);

    //获取用户信息
    public UserInfo getUserInfo(@Param("uid") int uid);

    //修改用户密码
    public int changePassword(@Param("newPassword") String newPassword,@Param("uid") int uid);

    //修改用户信息
    public int changeUserInfo(@Param("userInfo") UserInfo userinfo);
}
